ifeq ($(DEBUG),TRUE)
  C_FLAG ?= -I /usr/include/python3.8/ -fPIC -g -O0 
  CXX_FLAG ?= -std=c++17 -lstdc++ -I /usr/include/python3.8/ -fPIC -g -O0 
else
  C_FLAG ?= -I /usr/include/python3.8/ -fPIC -O
  CXX_FLAG ?= -std=c++17 -lstdc++ -I /usr/include/python3.8/ -fPIC -O
endif

.PHONY: clean test

all: example

example: example.c
	gcc $^ -o lib$@.so $(C_FLAG) -shared

test:
	chmod +x test1.py test2.py
	./test1.py
	./test2.py

clean:
	rm -fr build *.pyc *.o *.a *.so _embedded.*
